package com.mall.app.service.impl;

import com.mall.app.bean.TbGoods;
import com.mall.app.dao.TbGoodsMapper;
import com.mall.app.service.TbGoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 商品表 服务实现类
 * </p>
 *
 * @author LeeSin
 * @since 2020-07-10
 */
@Service
@Transactional
public class TbGoodsServiceImpl extends ServiceImpl<TbGoodsMapper, TbGoods> implements TbGoodsService {

	@Autowired
	private TbGoodsMapper goodsMapper;
	
	public List<TbGoods> listPage(Map<String, Object> map) {
		return goodsMapper.listPage(map);
	}

	public int getCount(Map<String, Object> map) {
		return goodsMapper.getCount(map);
	}

	@Override
	public boolean insertGoods(TbGoods goods) {
		return goodsMapper.insertGoods(goods)>0;
	}

	@Override
	public boolean updateGoods(TbGoods goods) {
		return goodsMapper.updateGoods(goods)>0;
	}

	@Override
	public boolean deleteGoods(String[] gids) {
		return goodsMapper.deleteGoods(gids)>0;
	}

	@Override
	public boolean updateGoodsQuantity(TbGoods goods) {
		return goodsMapper.updateGoodsQuantity(goods)>0;
	}

	

}
